package com.example.mobile2021606159yhf0506two;

import
        android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    private EditText edtTextMainUsername;
    private EditText edtTextMainPassword;
    private Button btnMainLogun;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainLogun.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent = new Intent(MainActivity.this,ShowDAtaActivity.class);
                intent.putExtra("userName",edtTextMainUsername.getText().toString().trim());
                Bundle bundle= new Bundle();
                bundle.putString("passWord",edtTextMainPassword.getText().toString().trim());
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        edtTextMainPassword = (EditText) findViewById(R.id.edtTextMainPassword);
        edtTextMainUsername = (EditText) findViewById(R.id.edtTextMainUsername);
        btnMainLogun = (Button) findViewById(R.id.btnMainLogun);
    }
}